#ifndef LINK_GRABBER_H
#define LINK_GRABBER_H

#include "iTube_GUI.h"
#include <wx/textfile.h>

#include <string>
#include <iterator>
#include <iostream>
#include <fstream>
#include <boost/regex.hpp>


#ifndef _DOWNLOAD_
#define _DOWNLOAD_
#include <wx/socket.h>
#include <wx/stream.h>
#include <wx/file.h>
#include <wx/url.h>

#endif






class LinkGrabber //will get the necessary values from the videos html page and format them
	{			 // into a direct link to the flv video, which we can download later

	public:
		LinkGrabber();
		LinkGrabber(wxString url);
		
		bool SetPage(wxString url);
		wxString GetDirectLink();
		wxString GetFnameId();
		
/*
		wxString GetVideoId();
		wxString GetTValue();
		wxString GetDirectVideoUrl();
		wxString GetDirectVideoUrl(wxString vId,wxString t);
		*/
	private:
		boost::regex SearchRegEx;
		boost::regex UrlRegEx;
		
		const char* Pre_Expression;
		const char* Narrowing_Expression;
		const char* Pre_Format;
		const char* Pre_Format_ID;
		
		wxString RawPageData; //filled from SavedVideoPage
		

		std::string fname_Id;
		wxString Filename;
		wxString PageUrl;  //the url to the page with the vid embedded in it
		wxURL PageReqUrl; //used to get the html page's input stream
		wxString VideoId;
		wxString TValue;
	};



#endif

		